<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>
        {{msg}}
        <father></father>
        <!-- <son></son> -->
    </div>
    <script type='text/javascript'>
        var son = {
            props: ['con'],
            // props: ['con','title'],
            data() {
                return {
                    msg: '我是子组件'
                }
            },
            template: `<div>{{msg}}-----{{con}}---</div>`,
            // template: `<div>{{msg}}-----{{con}}---{{title}}</div>`,
        }
        var father = {
            data() {
                return {
                    msg: '我是父组件',
                    text: '我是父组件的内容',
                    mess: '父组件2号'
                }
            },
            //向子组件传递内容，通过自定义的con属性并绑定text变量
            template: `<div>{{msg}}<son :con="text"></son></div>`,
            // template: `<div>{{msg}}<son :con="text" :title="mess"></son></div>`,
            components: {
                son
            }
        }
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            },
            components: {
                father
            }
        });
    </script>
</body>
</html>